﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    partial class Containers_ContainerWidgetPartRecord : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "Id":
                   {
                       return typeof(int);
                   }
                case "ContainerId":
                   {
                       return typeof(int?);
                   }
                case "PageSize":
                   {
                       return typeof(int?);
                   }
                case "OrderByProperty":
                   {
                       return typeof(string);
                   }
                case "OrderByDirection":
                   {
                       return typeof(int?);
                   }
                case "ApplyFilter":
                   {
                       return typeof(bool?);
                   }
                case "FilterByProperty":
                   {
                       return typeof(string);
                   }
                case "FilterByOperator":
                   {
                       return typeof(string);
                   }
                case "FilterByValue":
                   {
                       return typeof(string);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            Containers_ContainerWidgetPartRecord _instance = instance as Containers_ContainerWidgetPartRecord;
            switch (name)
            {                
                case "Id":
                   {
                       return _instance.Id;
                   }
                case "ContainerId":
                   {
                       return _instance.ContainerId;
                   }
                case "PageSize":
                   {
                       return _instance.PageSize;
                   }
                case "OrderByProperty":
                   {
                       return _instance.OrderByProperty;
                   }
                case "OrderByDirection":
                   {
                       return _instance.OrderByDirection;
                   }
                case "ApplyFilter":
                   {
                       return _instance.ApplyFilter;
                   }
                case "FilterByProperty":
                   {
                       return _instance.FilterByProperty;
                   }
                case "FilterByOperator":
                   {
                       return _instance.FilterByOperator;
                   }
                case "FilterByValue":
                   {
                       return _instance.FilterByValue;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            Containers_ContainerWidgetPartRecord _instance = instance as Containers_ContainerWidgetPartRecord;
            switch (name)
            {                
                case "Id":
                    {
                        _instance.Id = (int)value;
                        return;
                    }
                case "ContainerId":
                    {
                        _instance.ContainerId = (int?)value;
                        return;
                    }
                case "PageSize":
                    {
                        _instance.PageSize = (int?)value;
                        return;
                    }
                case "OrderByProperty":
                    {
                        _instance.OrderByProperty = (string)value;
                        return;
                    }
                case "OrderByDirection":
                    {
                        _instance.OrderByDirection = (int?)value;
                        return;
                    }
                case "ApplyFilter":
                    {
                        _instance.ApplyFilter = (bool?)value;
                        return;
                    }
                case "FilterByProperty":
                    {
                        _instance.FilterByProperty = (string)value;
                        return;
                    }
                case "FilterByOperator":
                    {
                        _instance.FilterByOperator = (string)value;
                        return;
                    }
                case "FilterByValue":
                    {
                        _instance.FilterByValue = (string)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new Containers_ContainerWidgetPartRecord();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<Containers_ContainerWidgetPartRecord>();
        }

        #endregion
    }
}
